package info.erge.dataStructure;

public class Student implements Comparable<Student> {
    private int age;
    private String name;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }

    @Override
    public String toString() {
        return String.format("name: %s, age: %d\n", name, age);
    }
}